<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="pc/include :: header('首页')" />
</head>
<body>
<th:block th:include="pc/include :: top" />
<div class="banner">
  <div class="banner_wrapper unselect">
    <div id="banner">
      <ul>

        <li th:each="item :${banner_array}"><a th:href="${item.src}?${item.src}:'javascript:void();'"><img th:src="${item.img}" th:alt="${item.name}"></a></li>

      </ul>
    </div>
    <a class="banner_prev">&lsaquo;</a>
    <a class="banner_next">&rsaquo;</a>
    <p class="banner_pagination"></p>
  </div>

  <div class="banner_notice">
    <div>
      <p class="fl">公告</p>
      <!-- <a class="fr" href="notice.html" target="_blank" rel="nofollow">更多></a>-->
    </div>
    <ul>

      <li th:each=" item :${notice_array}"><a th:href="@{notice.htm(id=${item.noticeId})}" target="_blank" class="import"><span>[公告]</span><span th:text="${item.noticeTitle}" th:remove="tag"></span></a></li>


    </ul>
  </div>
</div>
<div class="iw">
  <div class="point_a">
    <ul>
      <li class="point1">
        <i></i>
        <div>
          <h4>学无止境</h4>
          <p>书山有路勤为径，学海无涯苦作舟</p>
        </div>
      </li>
      <li class="point2">
        <i></i>
        <div>
          <h4>海量资源免费阅读</h4>
          <p>不用登录，海量资源即可免费看</p>
        </div>
      </li>
      <li class="point3">
        <i></i>
        <div>
          <h4>VIP会员免费下载</h4>
          <p>精品文档，VIP会员免费下载</p>
        </div>
      </li>
      <li class="point4">
        <i></i>
        <div>
          <h4>全部资源 <span class="color-tip">1000 +</span> </h4>
          <p>资源每天都会更新，数量持续增加</p>
        </div>
      </li>
    </ul>
  </div>
  <div class="point_b">
    <p><i></i>交易动态</p>
    <div class="point_dynamic">
      <ul>
        <div th:each="item :${pointpot_array}"  th:remove="tag" >
          <li th:if="${item.type} == 1">用户 <a href='1.html' th:text="${item.nickname}"></a> 注册了，奖励积分+<span th:text="${item.points}"></span></li>
          <li th:if="${item.type} == 2">用户 <a href='1.html' th:text="${item.nickname}"></a> 登录了，奖励积分+<span th:text="${item.points}"></span></li>
          <li th:if="${item.type} == 3">用户 <a href='1.html' th:text="${item.nickname}"></a> 完善了用户信息，奖励积分+<span th:text="${item.points}"></span></li>
          <li th:if="${item.type} == 4">用户 <a href='1.html' th:text="${item.nickname}"></a> 上传了<a th:href='1.html' th:text="${item.title}"></a>文档，奖励积分+<span th:text="${item.points}"></span></li>
          <li th:if="${item.type} == 5">用户 <a href='1.html' th:text="${item.nickname}"></a> 的文档<a th:href='1.html' th:text="${item.title}"></a>被推荐了，奖励积分+<span th:text="${item.points}"></span></li>
          <li th:if="${item.type} == 6">用户 <a href='1.html' th:text="${item.nickname}"></a> 的文档<a th:href='1.html' th:text="${item.title}"></a>被设为VIP，奖励积分+<span th:text="${item.points}"></span></li>
          <li th:if="${item.type} == 7">用户 <a href='1.html' th:text="${item.nickname}"></a> 完成了访问推广任务，奖励积分+<span th:text="${item.points}"></span></li>
          <li th:if="${item.type} == 8">用户 <a href='1.html' th:text="${item.nickname}"></a> 完成了注册推广任务，奖励积分+<span th:text="${item.points}"></span></li>
        </div>
      </ul>
    </div>
  </div>

  <div class="newdocs">
    <div class="block_head">
      <span><a href='1.html' rel="nofollow">最新文档</a></span>
      <a class="more" href="/doc.html" rel="nofollow">更多...</a>
    </div>
    <ul class="thum_ul">

      <li th:each="item :${newdoc_array}">
        <a th:href="@{detail.htm(docid=${item.docid})}">
          <div class="thum">
            <img th:src="${item.path}" class="zoom_img">

            <i th:if="${item.downpay}==0" class="mf">免费</i>
            <i th:unless="${item.downpay==0}" class="ff"><span th:text="${item.downpay}"></span></i>
            <i th:if="${item.isvip} and ${item.downpay!=0}" class="vmf">vip免</i>
            <i class="rb" th:classappend="${item.exten}"></i>
          </div>
          <h3 th:text="${item.title}" class="thum_tit"></h3>
        </a>
        <div class="thum_bottom">
           <span th:text="${item.readcount}" th:remove="tag"></span> 次阅读</div>
      </li>
    </ul>
  </div>
  <div class="home-ad" th:each="item :${sysAdvList}" th:if="${item.id}==1" >
    <a target="_blank" th:href="${item.page}"><img th:src="${item.src}" /></a>
  </div>
  <!--免费-->
  <div class="newdocs">
    <div class="block_head">
      <span><a href='1.html' rel="nofollow">免费文档</a></span>
      <a class="more" href="/doc.html?first=0&second=0-0-0&third=3" rel="nofollow">更多...</a>
    </div>
    <ul class="thum_ul">

      <li th:each="item :${newdoc_free}">
        <a th:href="@{detail.htm(docid=${item.docid})}">
          <div class="thum">
            <img th:src="${item.path}" class="zoom_img">

            <i th:if="${item.downpay}==0" class="mf">免费</i>
            <i th:unless="${item.downpay==0}" class="ff"><span th:text="${item.downpay}"></span></i>
            <i th:if="${item.isvip} and ${item.downpay!=0}" class="vmf">vip免</i>
            <i class="rb" th:classappend="${item.exten}"></i>
          </div>
          <h3 th:text="${item.title}" class="thum_tit"></h3>
        </a>
        <div class="thum_bottom">
          <span th:text="${item.readcount}" th:remove="tag"></span> 次阅读</div>
      </li>
    </ul>
  </div>
  <!--vip免费-->
  <div class="newdocs">
    <div class="block_head">
      <span><a href='1.html' rel="nofollow">VIP免费</a></span>
      <a class="more" href="/vip.html?first=0&second=0-0-0&third=4" rel="nofollow">更多...</a>
    </div>
    <ul class="thum_ul">

      <li th:each="item :${newdoc_vip}">
        <a th:href="@{detail.htm(docid=${item.docid})}">
          <div class="thum">
            <img th:src="${item.path}" class="zoom_img">

            <i th:if="${item.downpay}==0" class="mf">免费</i>
            <i th:unless="${item.downpay==0}" class="ff"><span th:text="${item.downpay}"></span></i>
            <i th:if="${item.isvip}" class="vmf">vip免</i>
            <i class="rb" th:classappend="${item.exten}"></i>
          </div>
          <h3 th:text="${item.title}" class="thum_tit"></h3>
        </a>
        <div class="thum_bottom">
          <span th:text="${item.readcount}" th:remove="tag"></span> 次阅读</div>
      </li>
    </ul>
  </div>

  <div class="imp-user">
    <div class="block_head">
      <span>活跃用户</span>
    </div>
    <div class="sbody">
      <ul>

        <li th:each="item :${impuser}">
          <div class="user-head">
            <a th:href="@{'/user/doclist/'+${item.userid}}"><img th:src="${item?.photo} ? ${item?.photo} : @{/img/photo.png}" /></a>
            <a th:href="@{'/user/doclist/'+${item.userid}}"><span><i th:if="${item.vipuser}" class="v"></i> <span th:text="${item.nickname}" th:remove="tag"></span></span></a>
          </div>
          <ul class="user-info">
            <li>
              <p th:text="${item.count}"></p>
              <span>文档数</span>
            </li>
            <li>
              <p th:text="${item.readcount}"></p>
              <span>浏览量</span>
            </li>
            <li>
              <p th:text="${item.downcount}"></p>
              <span>下载量</span>
            </li>
          </ul>
        </li>

        <ul>
    </div>
  </div>
  <div class="home-ad" th:each="item :${sysAdvList}" th:if="${item.id}==2" >
    <a target="_blank" th:href="${item.page}"><img th:src="${item.src}" /></a>
  </div>
  <div th:if="${#lists.size(partner)}>0" th:remove="tag" >
  <div  style="clear: both;height:20px"></div>
  <div class="partner">
    <div class="block_head">
      <span>合作伙伴</span>
    </div>
    <ul>

      <li th:each="item :${partner}"><a target="_blank" th:href="${item.src}"><img th:src="${item.img}" /></a></li>

    </ul>
  </div>

  </div>

  <div th:if="${#lists.size(links)}>0" th:remove="tag" >
  <div  style="clear: both;height:20px"></div>
  <div class="links">
    <div class="block_head">
      <span>友情链接</span>
    </div>
    <ul>

      <li th:each="item :${links}"><a target="_blank" th:href="${item.src}" th:text="${item.name}"></a></li>

    </ul>
  </div>
  </div>

</div>
<th:block th:include="pc/include :: footer" />
</html>
<script th:src="@{/js/jquery.jcarousel.min.js}"></script>
<script th:src="@{/js/jquery.jcarousel-fade.min.js}"></script>
<script>
  $(function () {
    //banner
    $('#banner').jcarousel({
      vertical: true,
      wrap: 'circular'
    });
    $('#banner').jcarouselAutoscroll({
      interval: 5000
    });
    $('.banner_prev').jcarouselControl({
      target: '-=1',
      method: 'fade'
    });
    $('.banner_next').jcarouselControl({
      target: '+=1',
      method: 'fade'
    });
    $('.banner_pagination').on('jcarouselpagination:active', 'a', function () {
      $(this).addClass('active');
    }).on('jcarouselpagination:inactive', 'a', function () {
      $(this).removeClass('active');
    }).jcarouselPagination({
      method: 'fade'
    });

    //动态交易
    $('.point_dynamic').jcarousel({
      vertical: true,
      wrap: 'circular'
    });
    $('.point_dynamic').jcarouselAutoscroll({
      interval: 1500
    });

    //推荐文档
    $('.home_imp_body').jcarousel({
      wrap: 'circular'
    });
    $('.home_imp_body').jcarouselAutoscroll({
      interval: 5000
    });
    $('.home_imp .prev').jcarouselControl({
      target: '-=1'
    });
    $('.home_imp .next').jcarouselControl({
      target: '+=1'
    });

    //悬赏交易
    $('.dynamic .sbody').jcarousel({
      vertical: true,
      wrap: 'circular'
    });
    $('.dynamic .sbody').jcarouselAutoscroll({
      interval: 2000
    });

    //最新文档
    $(".newdocs .block_head a").click(function () {
      $(".newdocs .block_head a").removeClass("active");
      $(".newdocs .thum_ul").hide();
      $(this).addClass("active");
      $("#newdoc_" + $(this).attr("data-id")).show();
    });

    var reward_id = 1;
    $(".reward_day .change").click(function () {
      $.get("home/reward/" + ++reward_id, function (data) {
        var reward = eval('(' + data + ')');
        var length = reward.length;
        if (length > 0) {
          var ul = '';
          for (var i = 0; i < length; i++) {
            ul += '<li>' +
                    '<a href="' + reward[i].docid + '.html">' +
                    '<div class="reword_h1">' +
                    '<span>悬赏</span>' +
                    '<p>' + reward[i].title + '</p>' +
                    '</div>' +
                    '</a>' +
                    '<div class="reword_h2">' +
                    '<p class="fl">赏金：<span><?php echo $tradeset->glodname ?>' + reward[i].price + '<?php echo $tradeset->glodunit ?></span></p>' +
                    '<p class="fr"><i></i>截至日期：<span>' + reward[i].todate + '</span></p>' +
                    '</div>' +
                    '</li>';
          }
        } else {
          reward_id = 0;
          $(".reward_day .change").trigger("click");
        }
        $(".reward_day .sbody ul").html(ul);
      });
    });

    if('<?php echo $user->nickname; ?>' == '<?php echo $user->username; ?>'){
      Dialog("请及时修改你的昵称","修改昵称",function name() {
        location="center/account.html";
      });
    }
  });
</script>